<html>
<head><meta charset="utf-8"><title>Replacing a node with a token · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Replacing.20a.20node.20with.20a.20token.html">Replacing a node with a token</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241691408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Replacing%20a%20node%20with%20a%20token/near/241691408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Replacing.20a.20node.20with.20a.20token.html#241691408">(Jun 06 2021 at 13:14)</a>:</h4>
<p>I'm trying to replace a <code>SyntaxNode</code> with a whitespace token of the same length, but I can't find a rowan API that lets me create a <code>SyntaxToken</code> – what would be the right approach here?</p>



<a name="241691441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Replacing%20a%20node%20with%20a%20token/near/241691441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lukas Wirth <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Replacing.20a.20node.20with.20a.20token.html#241691441">(Jun 06 2021 at 13:15)</a>:</h4>
<p><code>syntax::ast::make::tokens::whitespace</code></p>



<a name="241691491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Replacing%20a%20node%20with%20a%20token/near/241691491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Replacing.20a.20node.20with.20a.20token.html#241691491">(Jun 06 2021 at 13:16)</a>:</h4>
<p>ah, nice</p>



<a name="241691577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Replacing%20a%20node%20with%20a%20token/near/241691577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Replacing.20a.20node.20with.20a.20token.html#241691577">(Jun 06 2021 at 13:19)</a>:</h4>
<p>somehow I forgot about that module</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>